home *** CD-ROM | disk | FTP | other *** search
/ PC Graphics Unleashed / PC Graphics Unleashed.iso / polyray / plydat / dat / animate / thresh / squirm.pi < prev    next >
Encoding:
Text File  |  1992-11-22  |  3.8 KB  |  159 lines

  1. //
  2. // Demonstration of a squirming blob shape
  3. //
  4. // Polyray input file - Alexander Enzmann
  5. //
  6.  
  7. // Define the range of the animation
  8. start_frame  0
  9. end_frame    119
  10. total_frames 120
  11. outfile sqrm
  12.  
  13. // Set up the camera
  14. viewpoint {
  15.    from <0,3,-20>
  16.    at <0,0,0>
  17.    up <0,1,0>
  18.    angle 45
  19.    resolution 160, 160
  20.    }
  21.  
  22. // Set up background color & lights
  23. background midnightblue
  24. light <-10,20,-50>
  25. light < 10,20,-50>
  26.  
  27. define shiny_red
  28. texture {
  29.    surface {
  30.       ambient red, 0.2
  31.       diffuse red, 0.6
  32.       specular white, 0.8
  33.       microfacet Reitz 10
  34.       }
  35.    }
  36.  
  37. // Give the (time dependent) location of the blob points
  38. define ang radians(6 * frame)
  39. define squirm_thresh 0.15
  40.  
  41. // The values of r and s are used to define how far each of the pieces of the
  42. // blob move and how fast they move respectively.
  43. define r10 1
  44. define r11 1
  45. define r20 2
  46. define r21 1
  47. define r30 2
  48. define r31 3
  49. define r40 3
  50. define r41 4
  51. define r50 4
  52. define r51 1
  53. define r60 1
  54. define r61 3
  55. define r70 2
  56. define r71 2
  57. define r80 3
  58. define r81 5
  59.  
  60. define s1 3
  61. define s2 2
  62. define s3 1.5
  63. define s4 1
  64. define s5 3
  65. define s6 2
  66. define s7 1.5
  67. define s8 1
  68. define s09 2
  69. define s10 1.5
  70. define s11 3
  71. define s12 1.5
  72. define s13 2
  73. define s14 3
  74. define s15 2
  75. define s16 1.5
  76. define s17 1
  77.  
  78. define r09x 3
  79. define r09y 2
  80. define r09z 1
  81. define r10x 1
  82. define r10y 2
  83. define r10z 1
  84. define r11x 2
  85. define r11y 0.5
  86. define r11z 3
  87. define r12x 5
  88. define r12y 0
  89. define r12z 0
  90. define r13x 3
  91. define r13y 3
  92. define r13z 3
  93. define r14x 4
  94. define r14y 0
  95. define r14z 1
  96. define r15x 0
  97. define r15y 0
  98. define r15z 4
  99. define r16x 0
  100. define r16y 3
  101. define r16z 0.5
  102.  
  103. // Define some offset angles - this way the blob pieces won't all be lined
  104. // up when the animation starts.
  105. define o09 radians(0)
  106. define o10 radians(192)
  107. define o11 radians(15)
  108. define o12 radians(20)
  109. define o13 radians(117)
  110. define o14 radians(300)
  111. define o15 radians(270)
  112. define o16 radians(90)
  113.  
  114. //
  115. // Define the positions of the various component parts of the blob, by using
  116. // The values defined above, we have each of the 16 blob compoents moving in
  117. // independent circles, ellipses, and line.
  118. //
  119. define loc1 < r10 * cos(s1*ang), 0, r11 * sin(s1*ang)>
  120. define loc2 < r20 * cos(s2*ang), 0, r21 * sin(s2*ang)>
  121. define loc3 < r30 * cos(s3*ang), 0, r31 * sin(s3*ang)>
  122. define loc4 < r40 * cos(s4*ang), 0, r41 * sin(s4*ang)>
  123. define loc5 < r50 * cos(s5*ang), r51 * sin(s5*ang), 0>
  124. define loc6 < r60 * cos(s6*ang), r61 * sin(s6*ang), 0>
  125. define loc7 < r70 * cos(s7*ang), r71 * sin(s7*ang), 0>
  126. define loc8 < r80 * cos(s8*ang), r81 * sin(s8*ang), 0>
  127.  
  128. define loc09 <r09x*cos(s09*ang+o09),r09y*cos(s09*ang+o09),r09z*cos(s09*ang+o09)>
  129. define loc10 <r10x*cos(s10*ang+o10),r10y*cos(s10*ang+o10),r10z*cos(s10*ang+o10)>
  130. define loc11 <r11x*cos(s11*ang+o11),r11y*cos(s11*ang+o11),r11z*cos(s11*ang+o12)>
  131. define loc12 <r12x*cos(s12*ang+o12),r12y*cos(s12*ang+o12),r12z*cos(s12*ang+o12)>
  132. define loc13 <r13x*cos(s13*ang+o13),r13y*cos(s13*ang+o13),r13z*cos(s13*ang+o13)>
  133. define loc14 <r14x*cos(s14*ang+o14),r14y*cos(s14*ang+o14),r14z*cos(s14*ang+o14)>
  134. define loc15 <r15x*cos(s15*ang+o15),r15y*cos(s15*ang+o15),r15z*cos(s15*ang+o15)>
  135. define loc16 <r16x*cos(s16*ang+o16),r16y*cos(s16*ang+o16),r16z*cos(s16*ang+o16)>
  136.  
  137. // And finally we build the blob shape.
  138. object {
  139.    blob squirm_thresh:
  140.       sphere loc1, 0.2, 3.0,
  141.       sphere loc2, 0.2, 3.0,
  142.       sphere loc3, 0.2, 3.0,
  143.       sphere loc4, 0.2, 3.0,
  144.       sphere loc5, 0.2, 3.0,
  145.       sphere loc6, 0.2, 3.0,
  146.       sphere loc7, 0.2, 3.0,
  147.       sphere loc8, 0.2, 3.0,
  148.       sphere loc09, 0.2, 3.0,
  149.       sphere loc10, 0.2, 3.0,
  150.       sphere loc11, 0.2, 3.0,
  151.       sphere loc12, 0.2, 3.0,
  152.       sphere loc13, 0.2, 3.0,
  153.       sphere loc14, 0.2, 3.0,
  154.       sphere loc15, 0.2, 3.0,
  155.       sphere loc16, 0.2, 3.0
  156.    uv_steps 20, 20
  157.    shiny_red
  158.    }
  159.